<!DOCTYPE html>
<html lang="en" xmlns:sec="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>修改页面</title>
    <link rel="stylesheet" href="/static/pengpai/component/pear/css/pear.css" />
</head>
<body>
<form class="layui-form" action="">
    <div class="mainBox">
        <div class="main-container">

            <div class="button-container" style="left: 15px" sec:authorize="hasAuthority('web:static:update')">

                <button  type="button" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit=""
                         lay-filter="index" ><i class="layui-icon layui-icon-delete" >更新首页</i></button>
                <button  type="button" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit=""
                         lay-filter="footer"  ><i class="layui-icon layui-icon-delete">更新底部</i></button>
                <button  type="button" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit=""
                         lay-filter="product" ><i class="layui-icon layui-icon-delete">更新产品页</i></button>
                <button  type="button" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit=""
                         lay-filter="honor" ><i class="layui-icon layui-icon-delete">更新荣誉资质页</i></button>
                <button  type="button" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit=""
                         lay-filter="contact" ><i class="layui-icon layui-icon-delete">更新联系我们页</i></button>
                <button  type="button" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit=""
                         lay-filter="header" ><i class="layui-icon layui-icon-delete">更新头部</i></button>


            </div>

        </div>

</form>
<script src="/static/pengpai/component/layui/layui.js"></script>
<script src="/static/pengpai/component/pear/pear.js"></script>
<script>
    layui.use(['form', 'jquery'], function() {
        let form = layui.form;
        let $ = layui.jquery;


        form.on('submit(footer)', function(data) {
            $.get('/createFooter?id=1',function (r){
                console.log(r);
                if(r.code === 200){
                    layer.msg('生成成功');

                }else{
                    layer.msg('提交失败！');
                }

            });
        });
        form.on('submit(product)', function() {
            $.get('/staticPage?code=product',function (r){
                console.log(r);
                if(r.code === 200){
                    layer.msg('生成成功');

                }else{
                    layer.msg('提交失败！');
                }

            });
        });
        form.on('submit(honor)', function() {
            $.get('/staticPage?code=honor',function (r){
                console.log(r);
                if(r.code === 200){
                    layer.msg('生成成功');

                }else{
                    layer.msg('提交失败！');
                }

            });
        });
        form.on('submit(contact)', function() {
            $.get('/createContact',function (r){
                console.log(r);
                if(r.code === 200){
                    layer.msg('生成成功');

                }else{
                    layer.msg('提交失败！');
                }

            });
        });
        form.on('submit(header)', function() {
            console.log("product")
            $.get('/createHeader',function (r){
                console.log(r);
                if(r.code === 200){
                    layer.msg('生成成功');

                }else{
                    layer.msg('提交失败！');
                }

            });
        });
        form.on('submit(index)', function() {
            $.get('/createIndex',function (r){
                console.log(r);
                if(r.code === 200){
                    layer.msg('生成成功');

                }else{
                    layer.msg('提交失败！');
                }

            });
        });


    })
</script>
<script>
</script>
</body>
</html>
